package com.sdonkey.score.bean;

import java.io.Serializable;

public class UserBalanceBean implements Serializable {
	private String userId;				// 用户id
	private String name;				// 用户名
	private String bank;				
	private String area;				// 地区
	private String status;				// 状态（">0"为正常）
	private String register_terminal;	// 注册方式
	private String total_balance;		// 总余额
	private String balance;				// 可用余额
	
	private String usable_balance;		
	private String credit_balance;
	private static final long serialVersionUID = 3839814465102608477L;

	public String getArea() {
		return area;
	}
	
	public void setArea(String area) {
		this.area = area;
	}
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		if (status != null) {
			int i = -1;
			try {
				i = Integer.parseInt(status);
			} catch (Exception e) {}
			if (i >= 0)
				this.status = "正常";
			else
				this.status = "账号异常";
		} else
			this.status = "账号异常";
	}

	public String getRegister_terminal() {
		return register_terminal;
	}

	public void setRegister_terminal(String register_terminal) {
		this.register_terminal = register_terminal;
	}

	public String getBalance() {
		if(balance != null) {
			return String.format("%.2f", Double.parseDouble(balance));
		} else {
			return usable_balance;
		}
	}

	public void setBalance(String balance) {
		if(balance != null) {
			this.balance = String.format("%.2f", Double.parseDouble(balance));
		} else {
			this.balance = balance;
		}
	}

	public String getCredit_balance() {
		if(credit_balance != null) {
			return String.format("%.2f", Double.parseDouble(credit_balance));
		} else {
			return "0";
		}
	}

	public void setCredit_balance(String credit_balance) {
		if(credit_balance != null) {
			this.credit_balance = String.format("%.2f",
					Double.parseDouble(credit_balance));
		} else {
			this. credit_balance = "0";
		}
	}

	public String getUsable_balance() {
		if(usable_balance != null) {
			return String.format("%.2f", Double.parseDouble(usable_balance));
		} else {
			return "0";
		}
	}

	public void setUsable_balance(String usable_balance) {
		if(usable_balance != null) {
			this.usable_balance = String.format("%.2f",
					Double.parseDouble(usable_balance));
		} else {
			this.usable_balance = usable_balance;
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTotal_balance() {
		return total_balance;
	}

	public void setTotal_balance(String total_balance) {
		this.total_balance = total_balance;
	}

}
